package delete4;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;

//客户端
public class UDP111 {
    public static void main(String[] args) throws Exception {

    DatagramSocket socket=new DatagramSocket(9696);

    while(true){
        BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
        String s = reader.readLine();
        byte[] bytes = s.getBytes();
        DatagramPacket packet=new DatagramPacket(bytes,0,bytes.length,
                InetAddress.getByName("localhost"),7474);
        socket.send(packet);
        if (s.equals("bye")){
            break;
        }
    }
    socket.close();




}
}
